import type { IQuery, IResponse, TableResponse } from '@/api/config/types';
import axios from 'axios'; // 确保你导入了正确的 axios 实例或配置

export interface LibrarySize {
  sizeId: string;
  sizeDesc: string;
  width: number;
  height: number;
  createTime: string;
  updateTime?: any;
}

const prefix = '/library/size';

export const queryLibrarySize = () => {
  return axios.get<IResponse<LibrarySize[]>>(`${prefix}/query`);
};
export const librarySizeList = (query: IQuery) => {
  return axios.get<TableResponse<LibrarySize>>(`${prefix}/list`, { params: query });
};

export const deleteLibrarySize = (ids: string[]) => {
  return axios.delete(`${prefix}/${ids.join(',')}`);
};

export const createLibrarySize = (data: LibrarySize) => {
  return axios.post(`${prefix}`, data);
};

export const updateLibrarySize = (data: LibrarySize) => {
  return axios.put(`${prefix}`, data);
};

export const getLibrarySize = (id: string | number) => {
  return axios.get(`${prefix}/${id}`);
};
